home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 22
/
Aminet 22 (1997)(GTI - Schatztruhe)[!][Dec 1997].iso
/
Aminet
/
util
/
cli
/
FlushTimer.lha
/
FlushTimer.doc
< prev
Wrap
Text File
|
1980-01-05
|
3KB
|
134 lines
****************************************************************************
FlushTimer V1.0 Olly Koenders 31-07-97
This little (!) util is CLI only and will call "C:Avail FLUSH" before
entering a delay loop that will call it recursively using timed intervals.
----------------------------------------------------------------------------
Template:
FlushTimer [x]
Where x is: 0 -> 15 minute intervals
: 1 to 9 -> 1 to 9 hour intervals.
"FlushTimer 5" will set the timed intervals to 5 hours between flushes.
----------------------------------------------------------------------------
FlushTimer will begin a background process when called so won't require to
be called with "Run <>NIL: FlushTimer".
Please note that Kickstart 1.3 and below flushes its libraries and
deallocates their used memory automatically when a task closes them, and the
1.3 "Avail" command doesn't have the "FLUSH" option, therefore this proggy
is 2.04+ only really..:)
The assembler source follows and requires no "includes" or "x-refs" and
should assemble straight up without modification. Original assembly was
with Maxon 4.5/5.0. This is a 10 minute hack and works without fault on
any processor and KS 2.04+.
You are free to change the code and reassemble as you see fit, just don't
fuck it up and pass it on as a bug of mine!
Any changes to the code should be added to the line below and then some
explanatory text about the changes before reassembling and distributing.
----------------------------------------------------------------------------
V1.0 31-07-97 Original assembly by Olly koenders - Australia.
No bugs. Executable size: 328 bytes.
****************************************************************************
section detach,code,public
execbase=4
openlib=-408
findtask=-294
createproc=-138
mode_new=1006
open=-30
execute=-222
delay=-198
code:
move.l execbase,a6
move.b (a0),number+3
lea dosname,a1
jsr openlib(a6) ;open dos.lib
move.l d0,dosbase
move.l d0,a6
lea code(pc),a0
move.l -4(a0),d3
clr.l -4(a0) ;change starting address
move.l #name,d1
moveq #0,d2
move.l #4096,d4
jsr createproc(a6) ;start process from "task"
moveq #0,d0
rts
section task,code,public ;<-- DO NOT REMOVE! Necessary!
task:
move.l dosbase,a6
move.l #outhandle,d1
move.l #mode_new,d2
jsr open(a6) ;open NIL: output
move.l d0,d5
lea table(pc),a0
move.l number(pc),d0
sub.b #$30,d0
add.b d0,d0
add.b d0,d0
move.l (a0,d0.w),d6 ;get delay from table and store
loopit:
move.l #proggy,d1 ;string to call
move.l d5,d2 ;<NIL:
move.l d5,d3 ;>NIL:
jsr execute(a6) ;run it
move.l d6,d1 ;the delay value
jsr delay(a6) ;and wait - no processor time wasted
bra.b loopit ;do it endlessly
dosname:
dc.b "dos.library",0
even
outhandle:
dc.b "NIL:",0
even
dosbase:
dc.l 0
number:
dc.l 0
table:
dc.l 45000 ;15 min
dc.l 180000 ;1 hour
dc.l 360000 ;2 hours
dc.l 540000 ;3
dc.l 720000 ;4
dc.l 900000 ;5
dc.l 1080000 ;6
dc.l 1260000 ;7
dc.l 1440000 ;8
dc.l 1620000 ;9
name:
dc.b "FlushTimer",0
even
proggy:
dc.b "C:Avail FLUSH",0
end